home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / wais / ir / lock.h < prev    next >
C/C++ Source or Header  |  1995-05-09  |  1KB  |  49 lines

  1. /* ----------------------------------------------------------------------------
  2.  
  3.     COPYRIGHT    1989 Thinking Machines Corporation
  4.     AUTHOR        Gordon Linoff
  5.     MODULE        lock.h -- #defines to use lock files
  6.     COMMENTS
  7.         $Header: /tmp_mnt/net/quake/proj/wais/wais-8-b5/ir/RCS/lock.h,v 1.6 92/05/04 17:19:18 jonathan Exp $
  8. ---------------------------------------------------------------------------- */
  9.  
  10. #ifndef _LOCK_H_INCLUDED
  11. #define _LOCK_H_INCLUDED
  12.  
  13. #include "cdialect.h"
  14.  
  15. #define INVALID_LOCK          -1
  16. #define LOCK_QUERY             0  /* processing a query */
  17. #define LOCK_UPDATE            1  /* updating database files that
  18.                                    * need exclu access , blocking
  19.                                    * queries */
  20. #define LOCK_DELETE_VERSION    2
  21. #define LOCK_CHECK_POINT       3
  22. #define LOCK_SERVER            4  /* entire server period */
  23. #define LOCK_INDEX             5  /* entire indexing period */
  24. #define NUM_LOCK_TYPES         6
  25.  
  26. extern long utlk_using_lock _AP((char *dbanme, long lock_type));
  27. extern long utlk_unset_lock _AP((char *dbname, long lock_type));
  28. extern long utlk_set_lock _AP((char *dbname, long lock_type));
  29.  
  30.  
  31.  
  32. #ifdef LOCK_STORAGE_MODULE
  33.  
  34. #define IN_LOCK_RANGE(l) ((l >= 0) && (l < NUM_LOCK_TYPES))
  35.  
  36. static char *lock_names[NUM_LOCK_TYPES] = {
  37.     ".query.lock",
  38.     ".update.lock",
  39.     ".delete-version.lock",
  40.     ".check-point.lock",
  41.     ".server.lock",
  42.     ".index.lock"
  43.     };
  44.  
  45.  
  46. #endif  
  47.  
  48. #endif /* #ifndef _LOCK_H_INCLUDED */
  49.